package com.jsb.laundry.model.vo;

import com.fasterxml.jackson.annotation.JsonAlias;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@ApiModel(value = "确认订单页面数据", description = "确认订单页面数据")
public class ConfirmOrderPageVo {

    @ApiModelProperty("当前可预约时间")
    private List<CurrentTimeVo> appointmentTimeList;

    @ApiModelProperty("地址信息")
    private List<UserAddressVo> addressInfo;

    @ApiModelProperty("vip标识( 0:无,非0有 )")
    private String vipFlag;

    @ApiModelProperty("优惠券")
    private List<CouponVo> couponInfo;

    @ApiModelProperty("地址信息")
    private List<OrderInfoVo> serveInfo;

    @ApiModelProperty("总数量")
    private String buyNumTotal;

    @ApiModelProperty("总优惠")
    private String discountTotal;

    @ApiModelProperty("原总价")
    private String originalPrice;

    @ApiModelProperty("实付金额")
    private String total;

    @ApiModelProperty("权益说明")
    private String equityExplain;


    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @Accessors(chain = true)
    @ApiModel(description = "预约时间")
    public static class CurrentTimeVo implements Serializable {

        @ApiModelProperty(value = "时间", example = "08-03")
        private String text;

        @ApiModelProperty(value = "时间戳", example = "1691049603936")
        private Long value;

        @JsonInclude(JsonInclude.Include.NON_EMPTY)
        private List<CurrentTimeVo> children = new ArrayList<>();
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @Accessors(chain = true)
    @ApiModel(description = "用户地址信息")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public static class UserAddressVo implements Serializable {

        private static final long serialVersionUID = 15L;
        //地址的唯一id
        @JsonAlias(value = {"ID"})
        @ApiModelProperty("地址的唯一id")
        private String id;
        //用户ID
        @ApiModelProperty("用户ID")
        private String userId;
        //用户名
        @ApiModelProperty("用户名")
        private String userName;
        //用户性别(0:男 , 1女)
        @ApiModelProperty("用户性别(0:男 , 1女)")
        private String userSex;
        //用户手机号
        @ApiModelProperty("用户手机号")
        private String userPhone;
        //用户地址
        @ApiModelProperty("用户地址")
        private String userAddress;
        //用户详细地址
        @ApiModelProperty("用户详细地址")
        private String userDetailAddress;
        // 城市id
        @ApiModelProperty("城市id")
        private String cityId;
        //用户经纬度
        @ApiModelProperty("用户经纬度")
        private String userPointXY;
        //是否为默认地址(1:默认，0：)
        @ApiModelProperty("是否为默认地址(1:默认，0：)")
        private String isDefault;
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @Accessors(chain = true)
    @ApiModel(value = "优惠券")
    public static class CouponVo {
        @ApiModelProperty("优惠券套餐id")
        private String tcId;
        @ApiModelProperty("优惠券套餐标题")
        private String title;
        @ApiModelProperty("原价")
        private String originalPrice;
        @ApiModelProperty("实付金额")
        private String total;
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @Accessors(chain = true)
    @ApiModel(value = "订单商品详情")
    public static class OrderInfoVo {

        @ApiModelProperty("商品ID")
        private String goodsId;

        @ApiModelProperty("商品名称")
        private String goodsName;

        @ApiModelProperty("商品图片")
        private String goodsImg;

        @ApiModelProperty("服务价格ID")
        private String serveId;

        @ApiModelProperty("服务类别描述")
        private String serveMsg;

        @ApiModelProperty("服务价格(单价)")
        private String servePrice;

        @ApiModelProperty("购买数量")
        private int buyNum;

        @ApiModelProperty("原价(单价*购买数量)")
        private String originalPrice;

        @ApiModelProperty("实付金额 (单价*购买数量*折扣)")
        private String total;

        @ApiModelProperty("分类id")
        private String cateId;

        @ApiModelProperty("分类名")
        private String cateName;

        @ApiModelProperty("权益")
        private String equityExplain;

    }


}
